#include <iostream>
#include <queue>

#define x first
#define y second

using namespace std;

typedef pair<int, int> PII;

queue<PII> q;

int n;

int main()
{
	cin >> n;
	
	for (int i = 1; i <= (1 << n); i ++ )
	{
		int v;
		cin >> v;
		
		q.push({v, i});
	}
	
	while (q.size() > 2)
	{
		int f = q.size();
		
		PII a = q.front(); q.pop();
		PII b = q.front(); q.pop();
		
		if (a.x < b.x) q.push(b);
		else q.push(a);
		
//		q.push(t);
	}
	
	PII a = q.front(); q.pop();
	PII b = q.front(); q.pop();
		
		if (a.x < b.x) cout << a.y << endl;
		else cout << b.y << endl;
	
	return 0;
}